import axios from "axios";

const request = axios.create({
  baseURL:"http://47.101.57.131:8101/",
  timeout:10000,
  method:"GET"
})

const onRejected = error => {
  return Promise.reject(error);
}

request.interceptors.request.use(
  (config) => {
  return config;
}, onRejected);

request.interceptors.response.use(
  async (response) => {
  console.log('响应后拦截到的参数',response)
  if (response.data.code!==0){
  //
    return Promise.reject('有点错误！！！');
  }else {
    return response.data.data
  }
}, onRejected);

export default request
